package com.yuelife.service.dao;
import com.github.pagehelper.PageInfo;
import com.yuelife.service.pojo.SOrder;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/****
 * @Author:admin
 * @Description:SOrder的Dao
 * @Date 2019/6/14 0:12
 *****/
public interface SOrderMapper extends Mapper<SOrder> {

    @Select("select * from s_order where storeId=#{storeId}")
    List<SOrder> selectSOrderByStoreId(Integer storeId);

    /**
     * 作为订单查询条件
     * @param sOrder
     * @return
     */
    List<SOrder> selectbySOrder(SOrder sOrder);

    /**
     * 取消订单，更新状态
     * @param orderId
     */
    @Update("update s_order set status=2 where order_Id=#{orderId}")
    void updateStatus(Integer orderId);

    /**
     * 确认收货，更新状态
     * @param orderId
     */
    @Update("update s_order set status=3 where order_Id=#{orderId}")
    void updateStatusConfirm(Integer orderId);

    /**
     * 支付成功
     * @param orderId
     */
    @Update("update s_order set status=1 where order_Id=#{orderId}")
    void updateStatuspay(Integer orderId);

}
